package com.ruoyi.swimming.domian;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 优惠券对象 coupon
 *
 * @author ruoyi
 * @date 2021-07-17
 */
public class Coupon extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 消费者id
     */
    @Excel(name = "消费者id")
    private Long customerId;

    /**
     * 消费者名称
     */
    @Excel(name = "消费者id")
    private String realName;

    /**
     * 优惠金额
     */
    @Excel(name = "优惠金额")
    private BigDecimal couponAmount;

    /**
     * 标题
     */
    @Excel(name = "标题")
    private String title;

    /**
     * 有效期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "有效期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date validPeriod;

    /**
     * 使用范围
     */
    @Excel(name = "使用范围")
    private String useRange;

    /**
     * 是否使用
     */
    @Excel(name = "是否使用")
    private Integer isUsed;

    /**
     * 是否删除
     */
    @Excel(name = "是否删除")
    @TableLogic
    private Integer isDel;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setCustomerId(Long customerId) {
        this.customerId = customerId;
    }

    public Long getCustomerId() {
        return customerId;
    }

    public void setCouponAmount(BigDecimal couponAmount) {
        this.couponAmount = couponAmount;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    public BigDecimal getCouponAmount() {
        return couponAmount;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }

    public void setValidPeriod(Date validPeriod) {
        this.validPeriod = validPeriod;
    }

    public Date getValidPeriod() {
        return validPeriod;
    }

    public void setUseRange(String useRange) {
        this.useRange = useRange;
    }

    public String getUseRange() {
        return useRange;
    }

    public void setIsUsed(Integer isUsed) {
        this.isUsed = isUsed;
    }

    public Integer getIsUsed() {
        return isUsed;
    }

    public void setIsDel(Integer isDel) {
        this.isDel = isDel;
    }

    public Integer getIsDel() {
        return isDel;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("customerId", getCustomerId())
                .append("realName", getRealName())
                .append("couponAmount", getCouponAmount())
                .append("title", getTitle())
                .append("validPeriod", getValidPeriod())
                .append("useRange", getUseRange())
                .append("isUsed", getIsUsed())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("isDel", getIsDel())
                .toString();
    }
}

